package com.czie.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class ChooseActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageView environmentImageView, homepageImageView, remotecontrolImageView;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choose);
        environmentImageView = findViewById(R.id.environmentImageView);
        homepageImageView = findViewById(R.id.homepageImageView);
        remotecontrolImageView = findViewById(R.id.remotecontrolImageView);
        environmentImageView.setOnClickListener(this);
        homepageImageView.setOnClickListener(this);
        remotecontrolImageView.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.environmentImageView:
                startActivity(new Intent(ChooseActivity.this, MainActivity.class));
                Toast.makeText(ChooseActivity.this, "跳转环境监测成功", Toast.LENGTH_SHORT).show();
                break;
            case R.id.homepageImageView:
                Toast.makeText(ChooseActivity.this, "当前在主界面无需跳转！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.remotecontrolImageView:
                startActivity(new Intent(ChooseActivity.this, CameraVideoActivity.class));
                Toast.makeText(ChooseActivity.this, "跳转远程控制成功", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}